<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>苏宁易购：我的购物车</title>  
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="shortcut icon" href="__STATIC__/Index/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="__STATIC__/Index/Css/global.css" />
<link rel="stylesheet" href="__STATIC__/Index/Css/cart.css" />
<link rel="stylesheet" href="__STATIC__/Index/Css/animate.min.css"/>
<script type="text/javascript" src="__STATIC__/Index/Js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/Index/Js/common.js"></script>  
<script type="text/javascript" src="__STATIC__/Index/Js/scrolltopcontrol.js"></script>
<script type="text/javascript" src="__STATIC__/Index/Js/jquery.hDialog.js"></script>
<script type="text/javascript" src="__STATIC__/Index/Js/cart.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="__STATIC__/Index/Js/DD_belatedPNG.js"></script>
<script>
    DD_belatedPNG.fix(".img_logo", "img");
</script>
<![endif]-->
<script type="text/javascript">
	var price_url = "{|U:'Cart/price_url'}";
	var price_reduce = "{|U:'Cart/price_reduce'}";
	var del_sid = "{|U:'Cart/del_sid'}";
	var order ="{|U:'Order/index'}";
</script>
</head>
<body>
<!--S header-->
	<div class="header">
		<div class="top_c">
			<div class="top_c_r">
				<ul class="top_list">

					<if value="!isset($_SESSION['uname'])">
					<li class="li_bg">
						<a href="{|U:'Member/login'}" class="a_login">登录</a>
						<a href="{|U:'Member/register'}" class="a_reg">注册</a>
					</li>
					<else/>
					<li class="li_bg">
						<a href="{|U:'Member/member'}" class="a_login">{$_SESSION['uname']}</a>
						<a href="{|U:'Member/out'}" class="a_reg">退出</a>
					</li>
					</if>
					 

					<li>  
						<a href="<if value="!$_SESSION['uid']">{|U:'Member/login'}<else />{|U:'member_order'}</if>" class="a_show">我的订单</a> 
						<div class="in_hide">
							<a href="javascript:void(0)" class="a_hide">待支付</a>
							<a href="javascript:void(0)" class="a_hide">待收货</a> 
						</div>

					</li>
					<li class="li_buy"><a href="{|U:'Cart/index'}">购物车</a><span><if value="$_SESSION['cart']['goods']">{$_SESSION['cart']['total_rows']}<else />0</if></span></li>
				</ul>
			</div>
		</div> 
	</div>
<!-- =========头部结束====================================== -->
<div class="cart_main">
	<div class="clogo"><a href="__ROOT__"></a></div>
	<div class="r cart_progress">
		<dl>
			<dt class="finish"><i>1</i><span>我的购物车</span></dt>
			<dt><i>2</i><span>确认订单</span></dt>
			<dt><i>3</i><span>付款</span></dt>
			<dt><i>4</i><span>支付成功</span></dt>
		</dl>
	</div>

</div>


<if value="$_SESSION['cart']['goods']">
<div class="cart_title"><i></i><p>购物车</p><span id="info" style="color:red;"></span></div>

<form action="<if value="!$_SESSION['uid']">javascript:void(0)<else />{|U:'Order/index'}</if>" method="post">
<table id="cart">
	<thead>
		<tr>
			<th>
			</th>
			<th>商品信息</th>
			<th>单价</th>
			<th>备注说明</th>
			<th>数量</th>
			<th>小计(元)</th> 
			<th>操作</th>
		</tr>
	</thead>
		<foreach from="$g_info" key="$k" value="$v">
			<tr class="{$k}">
				<td class='select'>
					<input type="checkbox" name="check[]" checked  value="{$k}"  class="check check_sel">
				</td>
				<td class='name'>
					<img src="__ROOT__/{$v.pic}" width='100' height='100' alt="" />
					<a href="">{$v.name}</a>
				</td>
				<td class='price'>{$v.price}</td>
				<td class='info'>
					
					<ul>
						<li>颜色：{$v.color}</li>
						<li>尺码：{$v.size}</li>
					</ul> 
				</td>
				
				<td class='number'>
					<span class='reduce'>-</span>
					<input type="text" value='{$v.num}' class="num_s"/>
					<input type="hidden" value="{$v.price}" class="price_s">
					<input type="hidden" value="{$k}" class="sid">
					<span class='plus'>+</span>
				</td>


				<td class='price price_total'>￥{$v.total}</td>
				<td class='delete'>
					<a href="javascript:void(0)" onclick="if(confirm('确定删除吗?')) location.href='{|U:'Cart/del_cart',array('g_id'=>$k)}'">删除</a> 
				</td>
				 
			</tr>
		</foreach>
	<tr>
		<td colspan='6' class='count'>
			<div class='total'>
				<input type="checkbox" name="" checked id="check" class="sel_all check"/> 全选
				
				<a href="javascript:void(0)" id='del_cart'>删除选中商品</a>
				<a href="javascript:void(0)" id='del_all' onclick="if(confirm('确定清空吗？')) location.href='{|U:'del_all'}'">清空购物车</a>
				<p>商品金额：<span id='subtotal'>￥{$total.total}</span></p>
				<p>商品总数：<span id='subtotal1'>{$total.total_rows}</span></p>
			</div>
			<div class='sub-btn'>
				<input type="submit" value="" class="buy <if value="!$_SESSION['uid']">rotateInUpLeft dialog</if>"> 
			</div>
		</td>
	</tr>
</table>
</form>



<else/>

<table id="cart" class="cart_add">	
	<tr> 
		<td colspan='6' class='count'>
			<div class='total total_add'>
				<div class="nocart"></div>
				您的购物车还是空的，<if value="!$_SESSION['uid']"><a href="{|U:'Member/login'}">马上登录</a>可展示您之前加入购物车的商品<else />赶快去<a href="__ROOT__">首页</a>挑选你喜欢的商品吧。:)</if>
			</div>
		</td>
	</tr>

</table>


</if>
<style type="text/css">
.in_tap{
	width:300px;height:270px;
	position: relative;　
}
.dl_l{
	width:300px;height:30px;
	background: #eee; 
}
.dl_l dt{
	width:100px;
	height:30px;　 
	float: left;
	cursor: pointer;
	font-size: 14px;
	font-weight: 700;
	color: #aaa;
	text-align: center;
	margin-left: 10px;
}
.dl_l dt.dt_cur{
	border-top: 2px solid #f90; 
	background: #fff; 
	color: #f90;
}
	</style>
		<include file="__VIEW__/Common/login_reg" />
	<script>

$(function(){
	var $el = $('.dialog');
	$el.hDialog();
	
	//提交并验证表单
	$('.submitBtn').click(function() {
		var $username = $('.username');
		if($username.val() == ''){
			$.tooltip('用户名还没填呢...'); $phone.focus();
		}else{
			$.tooltip('登录成功',500,true);
			setTimeout(function(){
				$el.hDialog('close',{box:'#HBox'},'{|U:'Order/index'}');  //跳转链接~
			},1000);
		}

	});
});

</script>
<include file="__VIEW__/Common/footer" />